

//TODO a(52)
function a52(module, exports, a) {
    var i = a(23), s = a(6), r = a(3), n = a(21), o = (a(2), function (e) {
        this.contDom = e.dom.cont, this.parentEl = e.dom.parentEl, this.coreVideo = e.coreVideo
    });
    r.extend(o, i);
    var l = {
        init: function () {
            this.playerData = this.manager.playerData;
            var e = r.bind(this.manager.lanFit.fit, this.manager.lanFit);
            this.curDefi = 0, this.nodes = {
                defiCon: this.parentEl.find(".hv_ico_clear"),
                optDefi: this.parentEl.find(".clear_ul"),
                btnDefi: this.parentEl.find(".hv_ico_clarity")
            }, this.defiEnum = {
                1: e("流畅"),
                2: e("标清"),
                3: e("高清"),
                4: e("超清"),
                5: e("1080P"),
                6: e("原画"),
                7: e("极速")
            }, this.addEvent()
        }, addEvent: function () {
            this.manager.listener.on(n.PLAY_STATE, function (e, t) {
                "ended" == t ? (this.nodes.defiCon.addClass("gray"), this.nodes.optDefi.removeClass("hover")) : this.nodes.defiCon.removeClass("gray")
            }, this), this.manager.evt.on("vjs_initDefiList", this.initDefi, this), this.manager.evt.on("vjs_videoRateChanged", this.onVideoRateChanged, this), "PC" == this.playerData.interactiveType ? (this.nodes.btnDefi.on("click", this.onBtnDefi, this), this.nodes.optDefi.on("click", this.onOptDefi, this)) : (this.nodes.btnDefi.on("touchend", this.onBtnDefi, this), this.nodes.optDefi.on("touchend", this.onOptDefi, this)), "base" == this.playerData.tplType && this.manager.evt.on(n.EVENT.RESIZE, this.onResize, this)
        }, onResize: function () {
            this.nodes.defiCon[0].style.display = "1" == this.playerData.config.definition && this.contDom.width() > 370 ? "block" : "none"
        }, onBtnDefi: function () {
            if (!this.nodes.defiCon.hasClass("gray")) {
                var e = this.nodes.optDefi;
                e.hasClass("hover") ? e.removeClass("hover") : e.addClass("hover")
            }
        }, onOptDefi: function (e) {
            var t = e.target;
            if ("li" == t.tagName.toLowerCase()) {
                var a = s(t).getAttr("value");
                if (a == this.curDefi)return;
                r.setCookie("defi", a, {
                    path: "/",
                    domain: n.HOST_NAME.LETV_COM,
                    expires: new Date(2099, 12, 30, 23, 59, 59)
                }), this.manager.evt.trigger("showTip", "changeDefi"), this.manager.evt.trigger(n.EVENT.PLAYER_COMMAND, "changeDefi", a)
            }
            this.nodes.optDefi.removeClass("hover")
        }, onVideoRateChanged: function (e) {
            this.curDefi = e.args[0];
            for (var t = this.nodes.optDefi[0], a = 0, i = t.children.length; a < i; a++) {
                var r = t.children[a];
                r.getAttribute("value") == this.curDefi ? s(r).addClass("hover") : s(r).removeClass("hover")
            }
            this.nodes.btnDefi[0].innerHTML = this.defiEnum[parseInt(this.curDefi)]
        }, initDefi: function (e) {
            for (var t = e.args[0], a = this.nodes.optDefi[0], i = [7, 1, 2, 3, 4, 5, 6], s = [], r = 0, n = i.length; r < n; r++)t[i[r]] && s.push('<li value="' + i[r] + '">' + this.defiEnum[parseInt(i[r])] + "</li>");
            a.innerHTML = s.join("")
        }
    };
    r.merge(o.prototype, l), module.exports = o
}

